package com.nuorui.module.system.domain.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author lengleng
 * @date 2017年11月9日23:33:27
 */
@Data
@ApiModel(value = "菜单树")
@EqualsAndHashCode(callSuper = true)
public class MenuTree extends TreeNode {
	/**
	 * 菜单图标
	 */
	@ApiModelProperty(value = "菜单图标")
	private String icon;
	/**
	 *  菜单名称
	 */
	@ApiModelProperty(value = "菜单名称")
	private String menuName;
	private boolean spread = false;
	/**
	 * 前端路由标识路径
	 */
	@ApiModelProperty(value = "前端路由标识路径")
	private String path;
	/**
	 * 路由缓冲
	 */
	@ApiModelProperty(value = "路由缓冲")
	private String keepAlive;
	/**
	 * 权限编码
	 */
	@ApiModelProperty(value = "权限编码")
	private String permission;
	/**
	 * 菜单类型 （0菜单 1按钮）
	 */
	@ApiModelProperty(value = "菜单类型,0:菜单 1:按钮")
	private String menuType;
	/**
	 * 排序值
	 */
	@ApiModelProperty(value = "排序值")
	private Integer orderNum;

	public MenuTree() {
	}

	public MenuTree(Long id, String menuName, Long parentId) {
		this.id = id;
		this.parentId = parentId;
		this.menuName = menuName;
	}

	public MenuTree(Long id, String menuName, MenuTree parent) {
		this.id = id;
		this.parentId = parent.getId();
		this.menuName = menuName;
	}

	public MenuTree(MenuVO menuVo) {
		this.setId(menuVo.getMenuId());
		this.setParentId(menuVo.getParentId());
		this.setMenuName(menuVo.getMenuName());
		this.setPath(menuVo.getPath());
		this.setMenuType(menuVo.getMenuType());
		this.setPermission(menuVo.getPermission());
		this.setKeepAlive(menuVo.getKeepAlive());
		this.setIcon(menuVo.getIcon());
		this.setOrderNum(menuVo.getOrderNum());
	}

}
